/*
 * GameResponse - Container for gameplay outputs.
 *
 * Copyright 2008 James W. Hofmann
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

package rules;

class GameResponse
{

	///// responses are composed with a style code(the type of message)
	// and the message data as a haxe array

	inline public static var msg_error = 0;
	// error string

	inline public static var msg_dryconfirm = 1;
	// null
		
	inline public static var msg_fortadd = 100;
	// [fortdata object, fortdata id]		
	inline public static var msg_fortrepair = 101;
	// fortdata object
	inline public static var msg_shooterupgrade = 102;
	// shooter object
	inline public static var msg_shooterdowngrade = 103;
	// shooter object
	inline public static var msg_fortdamage = 104;
	// [fortdata object, qty change]
	inline public static var msg_fortkill = 105;
	// fortdata object
	
	inline public static var msg_gameover = 200;
	// null
	
	inline public static var msg_terrain = 300;
	// [x, y, style]
	
	inline public static var msg_territory = 400;
	// [x, y, owner]
	
	inline public static var msg_energychange = 500;
	// qty
	
	inline public static var msg_shotadd = 600;
	// shot object
	inline public static var msg_shotmovement = 601;
	// shot object, shot pct
	inline public static var msg_shotdead = 602;
	// shot id

	inline public static var msg_creepadd = 700;
	// [creep id, creep object]
	inline public static var msg_creepmove = 701;
	// [creep object, percentage]
	inline public static var msg_creephurt = 702;
	// [creep object, new qty]
	inline public static var msg_creepkill = 703;
	// creep object
	
	inline public static var msg_newwave = 800;
	// wave object
	inline public static var msg_waveover = 801;
	// wave object

	inline public static var msg_towerselected = 900;
	// shooter object
	inline public static var msg_towertargetchange = 901;
	// shooter object

	inline public static var msg_shooterfired = 1000;
	// [shooter object, shot object]
	
	public var style : Int;
	public var message : Dynamic;
	
	public static var composition : Array<GameResponse>;
	
	public function new(style : Int, message : Dynamic)
	{
		this.style = style;
		this.message = message;
	}

	public static function startcomposition()
	{
		composition = new Array();
	}
	
	public static function addcomposition(addition : GameResponse)
	{
		composition.push(addition);
	}
	
}
